<?php 
if($rslt_jadwal != null) 
{
    if($rslt_jadwal->num_rows() == 0)
    {
        echo '<td colspan="6"><center>-Data tidak ditemukan-</center></td>';
    }
    else
    {
?>
<form class="rnd8" target="_laporan_<?php echo $id_tahun ?>" method="GET" action="<?php echo site_url('jadwal/download_laporan') ?>">
    <div align="right">
        <input type="hidden" name="id_tahun" value="<?php echo $id_tahun ?>" />
        <input type="hidden" name="id_kelas" value="<?php echo $id_kelas ?>" />
        <input type="hidden" name="id_siswa" value="<?php echo $id_siswa ?>" />
        <a class="button small green" href="#" onclick="submit()"><span class="icon-download-alt"></span> &nbsp;Download Jadwal Pelajaran</a>
    </div>
</form>
<center>
    <label style="font-size: 1.4em;">
        Jadwal Pelajaran 
        T.A <?php echo $rslt_jadwal->row()->tahun_angkatan ?> 
        <br/> 
        <br/> 
        Kelas <?php echo $rslt_jadwal->row()->nama_kelas ?>
        <br/> 
        <br/>   
    </label>
</center>

<table class="tabel_bordered rnd10" border="1">
    <thead>
        <tr>
            <th>Hari</th>
            <th>Jam Ke-</th>
            <th>Waktu</th>
            <th>Mata Pelajaran</th>
            <th>Pengajar</th>
            <th>Ruangan</th>
        </tr>       
    </thead>
<?php
$nomor = 0;
    foreach ($rslt_jadwal->result() as $value_jadwal)
            {
                $nomor++;
                if($nomor == 1)
                {
                    echo '<tr>';
                    echo '<td>'.  strtoupper(hari_indo($value_jadwal->hari)).'</td>';
                    echo '<td align="center">1</td>';
                    echo '<td align="center">07.15 - 08.15</td>';
                    echo '<td align="center"colspan="2">Upacara Bendera</td>';
                    echo '<td>Lapangan Upacara</td>';
                    echo '</tr>';
                }
                elseif($value_jadwal->jam_pelajaran == 3)
                {
                    echo '<tr>';
                    echo '<td>'.  strtoupper(hari_indo($value_jadwal->hari)).'</td>';
                    echo '<td align="center" colspan="2">09.15 - 09.30</td>';
                    echo '<td align="center" colspan="3">Istirahat Pertama</td>';
                    echo '</tr>';
                }
                elseif($value_jadwal->jam_pelajaran == 6)
                {
                    echo '<tr>';
                    echo '<td>'.  strtoupper(hari_indo($value_jadwal->hari)).'</td>';
                    echo '<td align="center" colspan="2">12.30 - 13.00</td>';
                    echo '<td align="center" colspan="3">Istirahat Kedua</td>';
                    echo '</tr>';
                }
                echo '<tr>';
                if($value_jadwal->istirahat == 0)
                {
                    echo '<td>'.  strtoupper(hari_indo($value_jadwal->hari)).'</td>';
                    echo '<td align="center">'.$value_jadwal->jam_pelajaran.'</td>';
                    echo '<td align="center">'.$value_jadwal->waktu.'</td>';
                    echo '<td>'.$value_jadwal->nama_pelajaran.'</td>';
                    echo '<td>'.$value_jadwal->nama_guru.'</td>';
                    echo '<td>'.$value_jadwal->ruangan.'</td>';
                }
                else
                {
                    echo '<td colspan="4"><center>-ISTIRAHAT-</center></td>';
                }
                echo '</tr>';
            }
        }
    }
    ?>
</table>